﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="sizeTemplateDetailByMember.aspx.cs" Inherits="StoreWeb.system.memberManage.sizeTemplateDetailByMember" %>

<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="../../lib/html5.js"></script>
<script type="text/javascript" src="../../lib/respond.min.js"></script>
<script type="text/javascript" src="../../lib/PIE_IE678.js"></script>
<![endif]-->
<link href="../../css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="../../css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="../../css/style.css" rel="stylesheet" type="text/css" />
<link href="../../lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
<link href="../../css/extension.css" rel="stylesheet" />
<link href="../../lib/My97DatePicker/skin/WdatePicker.css" rel="stylesheet" />
<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title></title>
</head>
<body>
<form   id="formmemberadd"  runat="server"  method="post"  >
  <div class="pd-20">
  
  <style>
  	.myTop-nav{ width:100%; height:36px; line-height:36px;}
	.myTop-nav .myLeft-select,
	.myTop-nav .myLeft-select span,
	.myTop-nav .myLeft-select select{ float:left; display:inline;}
	.myTop-nav .myLeft-select span{ margin-right:5px;}
	.myTop-nav .myLeft-select span.size{ margin-left:15px;}
	.myTop-nav .myLeft-select select{ height:24px; margin-top:6px; border:1px solid #9a9a9a;}
	.myTop-nav .myButtons{ float:right;}
  </style>
    <div class="myTop-nav">
    	<div class="myLeft-select">
        	<span>模板</span>
           <%-- <select><option value="合体版A短袖">合体版A短袖</option><option value="修身版A长袖" selected="selected">修身版A长袖</option><option value="修身版B长袖">修身版B长袖</option><option value="立领（ME11-166L)">立领（ME11-166L)</option><option value="合体版A长袖">合体版A长袖</option><option value="合体版B长袖">合体版B长袖</option><option value="舒适版A长袖">舒适版A长袖</option><option value="舒适版B长袖">舒适版B长袖</option><option value="修身版A短袖">修身版A短袖</option><option value="修身版B短袖">修身版B短袖</option><option value="合体版B短袖">合体版B短袖</option><option value="舒适版A短袖">舒适版A短袖</option><option value="舒适版B短袖">舒适版B短袖</option></select>
            <span class="size">尺寸</span>
            <select id="productsize"><option value="180/96A">180/96A</option><option value="165/80A">165/80A</option><option value="165/84A">165/84A</option><option value="170/88A">170/88A</option><option selected="selected" value="175/92A">175/92A</option><option value="185/100A">185/100A</option><option value="190/104A">190/104A</option><option value="190/108A">190/108A</option></select>--%>
            <select onchange=" changevalue( );"  runat="server"   id= "select" name="select"   > </select>
            <span class="size">尺寸</span>
            <input type="text"  value="" placeholder="" id="size" name="size" runat="server">
        </div>
         
    </div>
<style>
.myTable{ width:100%; min-width:700px; border-top:1px solid #e5e5e5; border-left:1px solid #e5e5e5;}
.myTable.add{ border-top:none;}
.myTable th, 
.myTable td{ height:35px; border-bottom:1px solid #e5e5e5; border-right:1px solid #e5e5e5;}
.myTable th{ font-weight:bold;}
.myTabs th{ text-align:center; background:#f3f3f3; cursor:pointer;}
.myTabs th.active{ background:#fff;}
.myTable th, 
.myTable td{ padding:0 5px;}
.myTable th{ color:#fff; background:#999999;}
.myTable td.tc{ text-align:center;}
.myTable .name{ width:100%; height:30px; line-height:30px; text-indent:4px; border:1px solid #fff;}
.myTable .button,
.myTable .number{ float:left;}
.myTable .button{ width:24px; height:24px; cursor:pointer;}

.myTable .minus{ background:url(/images/minus.jpg) center no-repeat;}
.myTable .plus{ background:url(/images/plus.jpg) center no-repeat;}
.myTable .number{ width:60px; height:22px; line-height:22px; padding:0 5px; text-align:center; border:1px solid #9a9a9a;}
.total-price{ width:100%; padding:5px 0; vertical-align:middle; text-align:right;}
.total-price i.text,.total-price em.price{ font-style:normal; line-height:32px;}
.total-price em.price{ margin-right:10px;}
</style>    
    <table class="myTable size" border="0" cellpadding="0" cellspacing="0">
    	<tr>
            <th width="33%">名称</th>
            <th width="33%">值</th>
            <th width="34%">操作</th>
        </tr>
        <%--<tr class="body">
        	<td><input class="name" type="text" value="合体版A短袖"   name="name"></td>
            <td>
            	<span class="button minus"></span>
                <input class="number" type="text" value="10.55"    name="value">
                <span class="button plus"></span>
            </td>
            <td><a class="del" href="javascript:;">删除</a></td>
        </tr>--%>
        <%=sizetemplateDetailstr %>
        
    </table>
    <table class="myTable add" border="0" cellpadding="0" cellspacing="0">
        <tr class="body">
        	<td class="tc"><input type="button" id="btnok" class="btn btn-success radius" value="新增行">  <button  ID="btnok2"   class="btn btn-primary radius" type="submit"><i class="Hui-iconfont"></i>保存</button></td>
        </tr>
    </table>
    <div>
         <asp:HiddenField ID="hidid" runat="server" />
         <input   type="hidden" value="sizeTemplateDetailByMember"    name="action">
         <input   type="hidden" id="id"    name="id" runat="server">
      <!-- AspNetPager 7.5 Copyright:2003-2015 Webdiyer (www.webdiyer.com) -->
      <!--记录总数只有一页，AspNetPager已自动隐藏，若需在只有一页数据时显示AspNetPager，请将AlwaysShow属性值设为true！-->
      <!-- AspNetPager 7.5 Copyright:2003-2015 Webdiyer (www.webdiyer.com) -->
    </div>
  </div>
</form>
<%--<script type="text/javascript" src="../../lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="../../lib/layer/1.9.3/layer.js"></script>
<script type="text/javascript" src="../../lib/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="../../js/H-ui.js"></script>
<script type="text/javascript" src="../../js/H-ui.admin.js"></script>--%>
     <script type="text/javascript" src="../../lib/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="../../lib/layer/1.9.3/layer.js"></script>
    <script type="text/javascript" src="../../lib/Validform/5.3.2/Validform.min.js"></script>
    <script type="text/javascript" src="../../lib/laypage/1.2/laypage.js"></script>
    <script type="text/javascript" src="../../lib/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript" src="../../js/H-ui.js"></script>
    <script type="text/javascript" src="../../js/H-ui.admin.js"></script>
<script>


    function changevalue() {
        var opt = document.getElementById("select").options;
        for (var i = 0; i < opt.length; i++) {
            if (opt[i].selected == true) {
                $.post("../../ajax/memberManage.aspx", { action: "selectsizeTemplate", sizetemplate: opt[i].value },
                function (data) {
                    //var $tr = data.appendTo($('.myTable.size'));
                    //$('biaotou').remove();
                    //var aa = '<tr>' +
                    //        '<th width="33%">名称</th>' +
                    //        '<th width="33%">值</th>' +
                    //        '<th width="34%">操作</th>' +
                    //        '</tr>';
                    $(data).appendTo($('.myTable.size'));
                });

            }
        }
    }

    function validateSize($tr) {
        var regexPoint2Number = /^-?\d+\.?\d{0,2}$/;
        var $input = $('.number', $tr)
			.bind('input propertychange blur', function () {
			    var $this = $(this);
			    var val = $this.val();
			    if (!regexPoint2Number.test(val)) {
			        if ('0' == val)
			            $this.val('0');
			        else
			            $this.val('');
			    }
			})
			.keydown(function (e) {
			    if (!((e.keyCode >= 48 && e.keyCode <= 57) || (e.keyCode >= 96 && e.keyCode <= 105)
					|| e.keyCode == 8 || e.keyCode == 9 || e.keyCode == 110))
			        return false;
			})
			.keyup(function () {
			    var $this = $(this);
			    var val = $this.val();
			    if (!regexPoint2Number.test(val))
			        val = '0';
			})
			.bind("paste", function () {
			    return false;
			});
        $('.minus', $tr).click(function () {
            var number = $input.val();
            number--;
            if (number < 0)
                number = 0.00;
            $input.val(Number(number).toFixed(2));
        });
        $('.plus', $tr).click(function () {
            var number = $input.val();
            number++;
            $input.val(Number(number).toFixed(2));
        });
        $('.del', $tr).click(function () {
            $tr.remove();
        });
    }
    $(function () {
        $.each($('tr.body', '.myTable.size'), function () {
            validateSize($(this));
        });
        $('.btn', '.myTable.add').click(function () {
            var $tr = $('<tr class="body">' +
				'<td><input class="name" type="text" value=""    name="name"></td>' +
				'<td>' +
					'<span class="button minus"></span>' +
					'<input class="number" type="text" value=""   name="value">' +
					'<span class="button plus"></span>' +
				'</td>' +
				'<td><a class="del" href="javascript:;">删除</a></td>' +
			'</tr>').appendTo($('.myTable.size'));
            $('.name', $tr).focus();
            validateSize($tr);
        });
    });

    $("#btnok2").click(function () {

  
        if (document.getElementsByName("name").length == 0) {
            alert("未添加参数");
            return
        }

        $.ajax({
            url: "../../ajax/memberManage.aspx",
            //请求的url地址
            data: $('#formmemberadd').serialize(),
            type: "POST",
            //请求方式
            async: true,//这个地方修改
            success: function (data) {
                //alert(data);
                //parent.layer.msg("提交成功", { icon: 1, time: 1000 });
                //window.location.href = "list.aspx";
                parent.layer.alert("保存成功", function () {
                    parent.location.reload();
                });
            },
            error: function (req) {
                alert(req);
            }
        });
        return false;//这个位置加一个返回失败
    });

</script>
</body>
</html>
